home *** CD-ROM | disk | FTP | other *** search
- Path: asmobj.larc.nasa.gov!jaapjl
- From: jaapjl@asmobj.larc.nasa.gov (Lee Jaap)
- Newsgroups: comp.lang.c
- Subject: Re: What the heck is ...?
- Date: 29 Feb 1996 18:14:36 GMT
- Organization: probably not speaking for AS&M Inc
- Message-ID: <JAAPJL.96Feb29131437@asmobj.larc.nasa.gov>
- References: <sconi-1102961642580001@ip-24.newportnet.net> <4fmlro$nfg_001@pr.mcs.net>
- <4fnd5c$9a2@solutions.solon.com> <4fogla$ijo_002@news.mcs.net>
- Reply-To: J Lee Jaap <jaapjl@asmsun.larc.nasa.gov>
- NNTP-Posting-Host: asmobj.larc.nasa.gov
- In-reply-to: mdp@mika-sys.com's message of Mon, 12 Feb 96 22:57:46 GMT
-
- In article <4fogla$ijo_002@news.mcs.net> mdp@mika-sys.com (Michael D. Perry) writes:
- |>Thank you for your comments.
- |>4. I would point out however that your response which so
- |>authoritatively negates my answer was lacking the correct answer
- |>in its place. Are you too far above the rest of us peons to
- |>answer such a lowly question as this? This is a shame as I, as
- |>well as others, might have learned something from your thorough
- |>and complete wisdom and knowledge on this subject had you
- |>corrected my 'hapless blunder.'
-
- I know I'm way behind with clc, and this may have been answered,
- so I'll post a short answer.
-
- Your points are well taken. This groups is for information,
- not flames. Mild flames may be acceptable (IMO), but only if
- accompanied by a correct answer.
-
- A decent ISO (ANSI) C book, and some traditional C books, will have a
- section on stdarg and varargs header files, which will explain
- variable argument lists. The FAQ may even mention them. Check the
- index or TOC.
-
- The idea is that the scanf and printf families of functions can take
- any number of arguments (after the format string) of varying types, so
- there has to be a way to pass and use a varying number of arguments.
- The compiler checks the type of only the fixed arguments (and makes
- sure they occur in a function reference), but performs the standard
- conversions (float to double, short or char to int) for the varying
- args, depending upon the function innards to be able to figure out
- how many arguments there are and what types they are.
-
- CAVEAT: When you use the stdarg facility (as with casts and some other
- elements of the language), you're telling the compiler not to do
- certain checks that modern compilers usually do, that you know that
- you're bending some of the usual rules, and that you take full
- responsibility for making sure you do everything right. It's like
- removing some of the guards on a piece of machinery for maintenance:
- it's your responsibility to not wear loose or dangly clothing that
- might get caught.
-
- Hmmm. Did I say a "short" answer? I think I've written what's
- necessary.
- --
- J Lee Jaap <JaapJL@ASMSun.LaRC.NASA.Gov> +1 804/865-7093
- employed by, not necessarily speaking for,
- AS&M Inc, Hampton VA 23666-1340
-